<!-- 数据绑定最常见的形式就是使用“Mustache”语法 (双大括号) 的文本插值 -->
<!-- Mustache 大胡子语法 括号长得像胡子-->
<!Doctype html>
<html>
<script type="text/javascript" src="./jquery.js"></script>
<link style="text/css" src="./bootstrap.css"></link>
<script type="text/javascript" src="./bootstrap.js"></script>
<script type="text/javascript" src="./mustache.js"></script>

<body>

</body>
<script id="tpl-greeting" type="text/html">
  <dl>
    <dt>Name</dt>
    <dd>{{name}}</dd>
    <dt>Time</dt>
    <dd>{{timeNow}}</dd>
  </dl>
</script>
<script>
  //模板
  var template = "<p>Hello {{name}}, it is {{{ignore name}}}.it is {{&name}}</p>";
  //数据
  var date = new Date();
  var view = {
    name: "<b>Jonny</b>",
    timeNow: date.getHours() + ':' + date.getMinutes()
  };
  console.info(template);
  var html = Mustache.render(template, view);
  $(document.body).append(html);
  var tpl = $('#tpl-greeting').html();
  console.info(tpl);
  var data = {
    name: '徐健',
    timeNow: date.getHours() + ':' + date.getMinutes()
  }
  $(document.body).append(Mustache.render(tpl, data));
</script>

</html>
